import 'package:flutter/material.dart';
import 'package:syn_4s/core/extension/int_extension.dart';
import 'package:syn_4s/ui/shared/app_theme.dart';

class GradientButton extends StatelessWidget {
  final VoidCallback onPressed;
  final Widget child;
  EdgeInsetsGeometry? margin;

  GradientButton({super.key, required this.onPressed, required this.child, this.margin});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: margin,
      width: double.infinity,
      height: 48.px,
      decoration: BoxDecoration(
        gradient: const LinearGradient(
          colors: [AppTheme.orangeColor, AppTheme.redColor],
          begin: Alignment.centerLeft,
          end: Alignment.centerRight,
        ),
        borderRadius: BorderRadius.circular(24.px),
          boxShadow: [
            BoxShadow(color: AppTheme.orangeColor, blurRadius: 4.px)
          ]
      ),
      child: ElevatedButton(
        style: ElevatedButton.styleFrom(
          backgroundColor: Colors.transparent,
          shadowColor: Colors.transparent,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(24.px),
          ),
        ),
        onPressed: onPressed,
        child: child,
      ),
    );
  }
}
